using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class SimpleAIMovement : MonoBehaviour
{
    [SerializeField] Transform target;
    NavMeshAgent agent;
    public bool IsRecting;
    // Start is called before the first frame update
    void Start()
    {

         agent = GetComponent<NavMeshAgent>();
        agent.updateRotation = false;
        agent.updateUpAxis = false;
        IsRecting = false;

    }
        // Update is called once per frame
        void Update()
    {
        if(IsRecting)
        agent.SetDestination(target.position);
        
    }
}
